package com.chen.rabbitmq.consumer;

import com.chen.rabbitmq.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import static com.chen.rabbitmq.config.ConfirmConfig.CONFIRM_QUEUE_NAME;

/**
 * @author Y·C
 * @version 1.0.0
 * @ClassName Consumer.java
 * @Description 接收消息
 * @createTime 2023年05月13日 15:58:00
 */
@Component
@Slf4j
public class ConfirmConsumer {

    @RabbitListener(queues =CONFIRM_QUEUE_NAME)
    public void receiveMsg(Message message){
        String msg=new String(message.getBody());
        log.info("接受到队列 confirm.queue 消息:{}",msg);
    }
}
